package com.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * 
 * 功能描述：退出登录 功能Servlet
 * 
 * Version： 1.0
 * 
 * date： 2016年6月27日 上午3:12:22
 * 
 * @author：XiaoBingBy
 *
 */
public class exitServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    public exitServlet() {
        super();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		HttpSession session = request.getSession();
		session.removeAttribute("MyUser");
		
		response.sendRedirect(request.getContextPath() + "/index.jsp");
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
